# !/usr/bin/env python3
# coding=utf-8

import zipfile


def module_analysis(zipfile_path: str) -> int:
    """
    :param zipfile_path: 压缩包路径
    :return: 返回代码行数
    """
    total_line_sum = 0
    with zipfile.ZipFile(zipfile_path, mode='r') as zfile:  # 只读方式打开压缩包

        for name in zfile.namelist():
            # 获取文件后缀
            suffix = name.split('.')[-1]
            if suffix not in ['py', 'xml', 'js', 'css', 'scss']:
                continue
            with zfile.open(name, 'r') as f:
                len_line = len(f.readlines())
                total_line_sum += len_line
    return total_line_sum
